<template>
  <div>
    <div class="box">猜你喜欢</div>
    <div class="sel">
         <span><select name="" id="select" ><option value="综合排序" v-for="(item , index) in option" :key="index">{{item}}</option></select></span>
        <span @click="mysort(index)" v-for="(item , index) in btnArr" :key="index">{{item}}</span>
    </div>
    <div class="spa">
        <span>年货节热卖</span>
        <span>津贴联盟</span>
        <span>满减优惠</span>
        <span>品质联盟</span>
    </div>
  </div>
</template>

<script>
export default {
    data(){
        return {
            option:['综合排序','hhh'],
            btnArr:['距离最近','销量最高','筛选']
        }
    },
    methods:{
        mysort(index){
            if(index==0){
                this.shoplist.sort((a,b)=>{
                    return a.minPriceTip - b.minPriceTip;
                })
            }
            else if( index == 1 ){ 
                this.shoplist.sort((a,b)=>{
                    return b.monthSalesTip - a.monthSalesTip;
                })
            }
        }
    }
}
</script>

<style lang='scss' scoped>
.box{
    font-size: 20px;
    font-weight: bold;
    margin:10px  20px;
}
.sel #select{
    border: none;
}
.sel span{
    display: inline-block;
    margin: 3px 15px;
    font-size: 14px;
    
}
.spa span{
    display: inline-block;
    margin: 10px 15px;
     font-size: 14px;
    background-color: #E3E4E5;
}

</style>
